home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / 83win / data1.cab / Basic_Plus_Examples / EMPANEL < prev    next >
Text File  |  2001-03-02  |  3KB  |  49 lines

  1. 10    ! ********************************************************
  2. 20    ! Example: Engine Monitor - Panel of Widgets
  3. 30    !
  4. 40    ! This program displays a simulated engine monitor for
  5. 50    ! a theoretical engine. Torque, pressure, and dwell are
  6. 60    ! displayed, as well as a Status Log.
  7. 70    !
  8. 80    ! ********************************************************
  9. 90    !
  10. 100       DIM Buf$[200]
  11. 110   !
  12. 120       ASSIGN @Panel TO WIDGET "PANEL";SET ("X":5,"Y":5,"WIDTH":400,"HEIGHT":320,"TITLE":" Example: Engine Monitor - Panel of Widgets","MAXIMIZABLE":1)
  13. 130       CONTROL @Panel;SET ("SYSTEM MENU":"Quit")
  14. 140       ON EVENT @Panel,"SYSTEM MENU" GOTO Finis
  15. 150   !
  16. 160       ASSIGN @M1lbl TO WIDGET "LABEL";SET ("X":5,"Y":5,"WIDTH":90,"HEIGHT":20,"VALUE":"Torque","BORDER":0),PARENT @Panel
  17. 170       ASSIGN @Meter1 TO WIDGET "METER";SET ("X":5,"Y":30,"WIDTH":90,"HEIGHT":160,"ARC WIDTH":3,"ORIENTATION":"RIGHT","SHOW LIMITS":0),PARENT @Panel
  18. 180   !
  19. 190       ASSIGN @B2lbl TO WIDGET "LABEL";SET ("X":150,"Y":5,"WIDTH":80,"HEIGHT":20,"VALUE":"Pressure","BORDER":0),PARENT @Panel
  20. 200       ASSIGN @Bar2 TO WIDGET "BAR";SET ("X":160,"Y":30,"WIDTH":60,"HEIGHT":90),PARENT @Panel
  21. 210       ASSIGN @B2dsp TO WIDGET "LABEL";SET ("X":160,"Y":125,"WIDTH":60,"HEIGHT":20,"BORDER":0),PARENT @Panel
  22. 220   !
  23. 230       ASSIGN @Lbl1 TO WIDGET "LABEL";SET ("X":270,"Y":5,"WIDTH":75,"HEIGHT":20,"BORDER":0,"VALUE":"Dwell"),PARENT @Panel
  24. 240       ASSIGN @Disp1 TO WIDGET "LABEL";SET ("X":270,"Y":30,"WIDTH":75,"HEIGHT":20),PARENT @Panel
  25. 250       ASSIGN @Lbl TO WIDGET "LABEL";SET ("X":130,"Y":155,"WIDTH":240,"HEIGHT":20,"VALUE":"Status Log","BORDER":0),PARENT @Panel
  26. 260       ASSIGN @Text TO WIDGET "PRINTER";SET ("X":130,"Y":185,"WIDTH":240,"HEIGHT":100),PARENT @Panel
  27. 270   !
  28. 280       Value=50
  29. 290       Siz=15
  30. 300  Loop_val:!
  31. 310       FOR I=1 TO 10000
  32. 320           IF Value<25 OR Value>=85 THEN Value=50
  33. 330           Torq=INT(Value+Siz*RND)
  34. 340           Pres=INT(Value+Siz*RND)
  35. 350           Dwell=INT(Value+Siz*RND)
  36. 360           Value=INT(Value+Siz*(RND-.5))
  37. 370     !
  38. 380           CONTROL @Meter1;SET ("VALUE":Torq)
  39. 390           CONTROL @Bar2;SET ("VALUE":Pres)
  40. 400           CONTROL @B2dsp;SET ("VALUE":Pres)
  41. 410           CONTROL @Disp1;SET ("VALUE":Dwell)
  42. 420           OUTPUT Buf$ USING "#,K,DDDD,3X,DDD,DDD,DDD";"Update #";I,Torq,Pres,Dwell
  43. 430           CONTROL @Text;SET ("APPEND TEXT":Buf$)
  44. 440       NEXT I
  45. 450       GOTO Loop_val
  46. 460   !
  47. 470       STOP
  48. 480  Finis: END
  49.